package com.hmall.order.web;

import com.hmall.common.cliet.ItemFeignClient;
import com.hmall.common.pojo.Item;
import com.hmall.order.Interceptor.ThreadLocalUtil;
import com.hmall.order.pojo.Order;
import com.hmall.order.pojo.OrderParameter;
import com.hmall.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.UUID;

@RestController
@RequestMapping("order")
public class OrderController {

   @Autowired
   private IOrderService orderService;

   @GetMapping("{id}")
   public Order queryOrderById(@PathVariable("id") Long orderId) {
      return orderService.getById(orderId);
   }
   //提交订单
   @PostMapping
   public Long submitOrder(@RequestBody OrderParameter orderParameter){
      return orderService.submitOrder(orderParameter);
   }
}
